loop-carried dependence(循环携带依赖):在程序(尤其是编译器与并行计算语境)中,指同一循环的不同迭代之间存在的数据依赖关系——后一次迭代需要用到前一次迭代产生或更新的数据,因此会限制循环的并行化、向量化或某些重排序优化。(相对地,loop-independent dependence 指同一迭代内的依赖。)
/ˈluːp ˌkærid dɪˈpɛndəns/
The compiler can’t parallelize the loop because there is a loop-carried dependence.
由于存在循环携带依赖,编译器无法将这个循环并行化。
When the statement writes to A[i] and a later iteration reads A[i-1], the loop-carried dependence prevents aggressive vectorization unless the transformation preserves the cross-iteration order.
当某条语句写入 A[i] 而后续迭代读取 A[i-1] 时,这种循环携带依赖会阻止激进的向量化,除非变换能保持跨迭代的执行顺序。
该术语由三部分构成:loop(循环)+ carried(由……携带/带过来,表示“跨迭代传递”)+ dependence(依赖)。合起来强调:依赖关系不是发生在同一次循环迭代内部,而是被“循环迭代序列”从前一轮“带到”后一轮。